package collection;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class SortInteger {
    public static void main(String[] args) {
        Random random = new Random();
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            list.add(random.nextInt(100));
        }
        System.out.println(list);//未改变的原始数据

        Collections.sort(list);//将数据进行升序排列
        System.out.println(list);

        Collections.reverse(list);//反转list元素
        System.out.println(list);
        System.out.println(list.get(0));
    }
}
